package com.slipper.system.message.front;

import org.springframework.web.bind.annotation.RestController;
import javax.annotation.Resource;

import com.slipper.common.bo.Result;
import com.slipper.common.util.ResultUtil;
import com.slipper.system.api.message.bo.MessageBO;
import com.slipper.system.api.message.service.IMessageSv;
import com.slipper.system.message.service.MessageService;

import java.util.List;

@RestController
public class MessageSv implements IMessageSv {
    @Resource
    private MessageService messageService;
    
    @Override
    public Result<MessageBO> queryBy(String id) {
        return ResultUtil.successResult(messageService.queryBy(id));
    }

    @Override
    public Result<List<MessageBO>> queryList(MessageBO bo) {
        return ResultUtil.successResult(messageService.queryList(bo));
    }
    
    @Override
    public Result<List<MessageBO>> queryPage(MessageBO bo) {
        return ResultUtil.successResult(messageService.queryPage(bo));
    }

    @Override
    public Result<List<MessageBO>> queryMyPage(MessageBO bo) {
        return ResultUtil.successResult(messageService.queryMyPage(bo));
    }

    @Override
    public Result<Long> queryMyCount(MessageBO bo) {
        return ResultUtil.successResult(messageService.queryMyCount(bo));
    }

    @Override
    public Result<?> save(MessageBO bo) {
        return ResultUtil.saveResult(messageService.save(bo));
    }
    
    @Override
    public Result<?> delete(MessageBO bo) {
        return ResultUtil.deleteResult(messageService.delete(bo));
    }

    @Override
    public Result<?> updateRead(MessageBO bo) {
        return ResultUtil.successResult(messageService.updateRead(bo));
    }
}
